package com.elem.service.impl;

import com.elem.bean.Business;
import com.elem.dao.BusinessDao;
import com.elem.dao.impl.BusinessDaoImpl;
import com.elem.service.BusinessService;

import java.util.Collections;
import java.util.List;

/*
*  在service层调用dao层，保存数据
* */
public class BusinessServiceImpl implements BusinessService {
    BusinessDao businessDao = new BusinessDaoImpl();
    @Override
    public List<Business> listBusinessByOrderTypeId(String orderTypeId) throws Exception {

        List<Business> businessList = businessDao.listBusinessByOrderTypeId(orderTypeId);
        return businessList;
    }

    @Override
    public Business getBusinessById(String businessId) throws Exception {
        Business business = businessDao.getBusinessById(Integer.parseInt(businessId));
        return business;
    }
}
